package cn.jacksigxu.min3halla.item;

import net.minecraft.world.InteractionResult;
import net.minecraft.world.item.ItemNameBlockItem;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.block.Block;

public class PlaceableFoodItem extends ItemNameBlockItem {

    public PlaceableFoodItem(Block pBlock, Properties pProperties) {
        super(pBlock, pProperties);
    }

    @Override
    public InteractionResult place(BlockPlaceContext pContext) {
        var player = pContext.getPlayer();
        if (player != null && player.isShiftKeyDown()) {
            return super.place(pContext);
        }
        return InteractionResult.FAIL;
    }
}
